package com.campus.campusdelivery.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class AddressDto {
    private Long id;
    
    @NotBlank(message = "收货人姓名不能为空")
    @Size(min = 2, max = 20, message = "姓名长度在2到20个字符之间")
    private String name;
    
    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入正确的手机号码")
    private String phone;
    
    @NotBlank(message = "详细地址不能为空")
    @Size(min = 5, max = 200, message = "详细地址长度在5到200个字符之间")
    private String detail;
    
    private Boolean isDefault = false;
    
    private LocalDateTime createTime;
}